package j2src;

import java.util.Vector;
import beans.VolEducationalDaoHome;
import beans.VolEducationalDaoRemote;
import beans.VolEducationalDto;


public class VolEducationalDaoDelegate {
	private VolEducationalDaoHome volEducationalDaoHome;
    private VolEducationalDaoRemote volEducationalDaoRemote;
    public VolEducationalDaoDelegate() throws Exception {
        initializeVolEducationalDaoHome();
        volEducationalDaoRemote = volEducationalDaoHome.create();
    }
    public Vector getAllVolEducational(String volId) throws Exception{
    	return volEducationalDaoRemote.getAllVolEducational(volId);
    }
	public boolean insertEducational(VolEducationalDto eDto) throws Exception{
		return volEducationalDaoRemote.insertEducational(eDto);
	}
	public boolean updateEducational(VolEducationalDto eDto) throws Exception{
		return volEducationalDaoRemote.updateEducational(eDto);
	}
    
    private void initializeVolEducationalDaoHome() throws Exception {
        String FACADE_NAME = "VolEducationalDaoBean";
        Class FACADE_CLASS = beans.VolEducationalDaoHome.class;
        if (volEducationalDaoHome == null) {
            try {
                WhiteDaoLocator locator = WhiteDaoLocator.getInstance();
                volEducationalDaoHome = (VolEducationalDaoHome) WhiteDaoLocator.getEjbHome(FACADE_NAME, FACADE_CLASS);
                if (volEducationalDaoHome == null) {
                    throw new Exception("Did not get home for " + FACADE_NAME);
                }
            } catch (WhiteDaoLocatorException e) {
                throw new Exception(e.getMessage());
            }
        }
    }
}
